<%-- 
    Document   : testDisplay
    Created on : Nov 19, 2012, 9:11:10 PM
    Author     : Thanh
--%>

<%@page import="data.UserDAL"%>
<%@page import="data.UserEntity"%>
<%@page import="java.util.Iterator"%>
<%@page import="java.util.Collection"%>
<%@page import="data.ProductDAL"%>
<%@page import="data.ProductEntity"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
        <table border ="1"><tr>
                        <td>Product</td> 
                        <td>Product Name</td>
                        <td>Category</td> 
                        <td>Unit Price</td> 
                        <td>Units In Stock</td> 
                        <td>Units In Order</td>
                        <td>Image</td>
                        <td>Description</td>
                        </tr>
                        <%         Collection<ProductEntity> list = ProductDAL.listAll();
                Iterator<ProductEntity> it = list.iterator();

                while (it.hasNext()) {
                    ProductEntity entity = it.next();
                    %>
                    <tr>
                    <td><%=entity.getProductId() %></td>
                    <td><%=entity.getProductName() %></td>
                    <td><%=entity.getCategoryId() %></td>
                    <td><%=entity.getUnitPrice() %></td>
                    <td><%=entity.getUnitsInStock() %></td>
                    <td><%=entity.getUnitsInOrder() %></td>
                    <td><%=entity.getProductImage() %></td>
                    <td><%=entity.getDescription() %></td>
                    </tr>
                    <% }%>
                </table>
                    <% UserEntity entity = UserDAL.setLogin("thanhndse90043");
                            %>
                            <h1><%=entity.getAddress()%></h1>
    </body>
</html>
